import {
    VALIDATE,
    ORDER,
    NOTIVELIST,
    EDITPASSWORD,
    GETAPPOINTlIST,
    TO_LOGIN,
    CHANGENOTIVELIST,
    GETNOTICEALL,
    WORKSTATIONlIST,
    ORDERWORKSTATION,
    CANCELWORKSTATION,
    GETSHINYSTATUS,
    GETSESSION
} from '@/config/url';
import request from '@/utils/request';

// 校验一个用户是否登录
export const validate = () => {
    return request(VALIDATE);
};
// 登录
export const login = (data={}) => {
    return request(TO_LOGIN, {method: 'post',data});
};
// 新加的
export const order = () => {
    return request(ORDER);
};
export const getNotive = (data) => {
    return request(NOTIVELIST,{data});
};
export const changeNotiveStatus = (data=[]) => {
    return request(CHANGENOTIVELIST, {method: 'post', data});
};
export const getNoticeAll= (data={}) => {
    return request(GETNOTICEALL, {data});
};
export const editPassword = (data={}) => {
    return request(EDITPASSWORD, {method: 'post',data});
};
export const getAppoint = (data={}) => {
    return request(GETAPPOINTlIST, {data});
};
export const getWorkStationList = () => {
    return request(WORKSTATIONlIST);
};
export const orderWorkStation = (id,data) => {
    const url = `${ORDERWORKSTATION}/${id}`
    return request(url, {method: 'post',data});
};
export const cancelWorkStation = (id) => {
    const url = `${CANCELWORKSTATION}/${id}`
    return request(url, {method: 'post'});
};
export const getShinyStatus = (id) => {
    const url = `${GETSHINYSTATUS}/${id}`
    return request(url);
};
export const getSession = (id) => {
    const url = `${GETSESSION}/${id}`
    return request(url);
};